package com.xhdd.controller;


import com.xhdd.dto.User;
import com.xhdd.serv.UserService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;

@RestController
@RequestMapping("user")
@Api(tags = "用户服务")
public class UserController {
    @Resource
    UserService userService;

    @PostMapping("addUser")
    public String addUser(@RequestBody User user) throws IOException {
        return userService.addUser(user);
    }

    @GetMapping("getUserList")
    public List<User> getUserList(String type) throws IOException {
        return userService.getUserList("Bob3", type);
    }

}

